using System.ComponentModel.DataAnnotations.Schema;
using System.Data.Entity.ModelConfiguration;using Maxleaf.EDI.Domain.K3;

namespace Maxleaf.EDI.DataAccess.K3
{
    public class ICCreditBillMap : EntityTypeConfiguration<ICCreditBill>
    {
        public ICCreditBillMap()
        {
            // Primary Key
            this.HasKey(t => new { t.FSource, t.FID });

            // Properties
            this.Property(t => t.FSource)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FID)
                .HasDatabaseGeneratedOption(DatabaseGeneratedOption.None);

            this.Property(t => t.FHeadTable)
                .HasMaxLength(30);

            this.Property(t => t.FEntryTable)
                .HasMaxLength(30);

            this.Property(t => t.FHeadKey)
                .HasMaxLength(30);

            this.Property(t => t.FEntryKey)
                .HasMaxLength(30);

            this.Property(t => t.FCustKey)
                .HasMaxLength(30);

            this.Property(t => t.FCustField)
                .HasMaxLength(30);

            this.Property(t => t.FEmpKey)
                .HasMaxLength(30);

            this.Property(t => t.FEmpField)
                .HasMaxLength(30);

            this.Property(t => t.FDepKey)
                .HasMaxLength(30);

            this.Property(t => t.FDepField)
                .HasMaxLength(30);

            this.Property(t => t.FBillNoKey)
                .HasMaxLength(30);

            this.Property(t => t.FBillNoField)
                .HasMaxLength(30);

            this.Property(t => t.FItemKey)
                .HasMaxLength(30);

            this.Property(t => t.FItemField)
                .HasMaxLength(30);

            this.Property(t => t.FQtyKey)
                .HasMaxLength(50);

            this.Property(t => t.FQtyField)
                .HasMaxLength(50);

            this.Property(t => t.FAmtKey)
                .HasMaxLength(50);

            this.Property(t => t.FAmtField)
                .HasMaxLength(50);

            this.Property(t => t.FStatusKey)
                .HasMaxLength(255);

            this.Property(t => t.FStatusField)
                .HasMaxLength(255);

            this.Property(t => t.FParaKey)
                .HasMaxLength(50);

            this.Property(t => t.FParaField)
                .HasMaxLength(50);

            // Table & Column Mappings
            this.ToTable("ICCreditBill");
            this.Property(t => t.FSource).HasColumnName("FSource");
            this.Property(t => t.FID).HasColumnName("FID");
            this.Property(t => t.FGroupID).HasColumnName("FGroupID");
            this.Property(t => t.FHeadTable).HasColumnName("FHeadTable");
            this.Property(t => t.FEntryTable).HasColumnName("FEntryTable");
            this.Property(t => t.FHeadKey).HasColumnName("FHeadKey");
            this.Property(t => t.FEntryKey).HasColumnName("FEntryKey");
            this.Property(t => t.FCustKey).HasColumnName("FCustKey");
            this.Property(t => t.FCustField).HasColumnName("FCustField");
            this.Property(t => t.FEmpKey).HasColumnName("FEmpKey");
            this.Property(t => t.FEmpField).HasColumnName("FEmpField");
            this.Property(t => t.FDepKey).HasColumnName("FDepKey");
            this.Property(t => t.FDepField).HasColumnName("FDepField");
            this.Property(t => t.FBillNoKey).HasColumnName("FBillNoKey");
            this.Property(t => t.FBillNoField).HasColumnName("FBillNoField");
            this.Property(t => t.FItemKey).HasColumnName("FItemKey");
            this.Property(t => t.FItemField).HasColumnName("FItemField");
            this.Property(t => t.FQtyKey).HasColumnName("FQtyKey");
            this.Property(t => t.FQtyField).HasColumnName("FQtyField");
            this.Property(t => t.FAmtKey).HasColumnName("FAmtKey");
            this.Property(t => t.FAmtField).HasColumnName("FAmtField");
            this.Property(t => t.FStatusKey).HasColumnName("FStatusKey");
            this.Property(t => t.FStatusField).HasColumnName("FStatusField");
            this.Property(t => t.FParaKey).HasColumnName("FParaKey");
            this.Property(t => t.FParaField).HasColumnName("FParaField");
            this.Property(t => t.FStatus).HasColumnName("FStatus");
            this.Property(t => t.FSyncPara0).HasColumnName("FSyncPara0");
        }
    }
}
